package pm.issue.service;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import pm.db.DBUtil;
import pm.issue.bean.IssueStateBean;
import pm.project.bean.ProjectBean;

public class IssueStateService {

	
	public List showAllIssueState(){
		List<IssueStateBean> list = new ArrayList<IssueStateBean>();

		String sql1 = "select * from pm_state";

		PreparedStatement past = null;
		Connection conn = DBUtil.getConnection();
		ResultSet rs = null;

		try {
			past = conn.prepareStatement(sql1);

			rs = past.executeQuery();
			while (rs.next()) {
				IssueStateBean issueState=new IssueStateBean();
				issueState.setStateName(rs.getString("state_name"));
				list.add(issueState);
			}
			rs.close();
			past.close();
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			DBUtil.close(conn);
		}
		return list;
	}
	
}
